package com.ap.core.business.message.validation.info.impl;

import com.ap.core.backoffice.domain.BackOfficeOrderPayment;
import com.ap.core.common.types.MessageStatus;
import com.ap.core.validation.message.info.RefundOriginalInfo;

public class RefundOriginalInfoImpl implements RefundOriginalInfo {
	

    private final BackOfficeOrderPayment orderPayment;

    public RefundOriginalInfoImpl(BackOfficeOrderPayment orderPayment) {
        this.orderPayment= orderPayment;
    }


    @Override
    public boolean isOrderPaymentExists(MessageStatus msgStatus) {
        return null != orderPayment && msgStatus == orderPayment.getStatusCode();
    }
    
    @Override
    public boolean isValidAPTransactionId(){
    	return null!=orderPayment;
    }
    
    
    @Override
    public boolean isAptrIdExists(String apTrId){
    	return null!=orderPayment && apTrId.equals(String.valueOf(orderPayment.getApTransactionRetrievalId()));
    }

	

}
